import Vue from 'vue'
import VueRouter from 'vue-router'
import userRoutes from "@/router/user";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: () => import('@/views/HomeView.vue'),
        redirect: {
            path: '/dashboard'
        },
        children: [
            {
                path: 'dashboard',
                name: 'dashboard',
                component: () => import('@/views/DashboardView.vue')
            },
            {
                path: 'audit-check-page',
                name: 'audit-check-page',
                component: () => import('@/views/audit/AuditCheckPageView.vue')
            },
            {
                path: 'audit-report-page',
                name: 'audit-report-page',
                component: () => import('@/views/audit/ReportCheckPageView.vue')
            },

            {
                path: 'user-page',
                name: 'user-page',
                component: () => import('@/views/manage/user/UserPageView')
            },
            {
                path: 'course-page',
                name: 'course-page',
                component: () => import('@/views/manage/course/CoursePageView')
            },
            {
                path: 'island-page',
                name: 'island-page',
                component: () => import('@/views/manage/island/IslandPageView')
            },
            {
                path: 'question-page',
                name: 'question-page',
                component: () => import('@/views/manage/question/QuestionPageView')
            },
            {
                path: 'config',
                name: 'config',
                component: () => import('@/views/manage/config/ConfigView')
            },
            {
                path: 'bonfire-page',
                name: 'bonfire-page',
                component: () => import('@/views/manage/config/BonfirePageView')
            },
            {
                path: 'appearance-config',
                name: 'appearance-config',
                component: () => import('@/views/manage/config/AppearanceConfigView')
            },
            {
                path: 'course-create',
                name: 'course-create',
                component: () => import('@/views/course/CourseCreateView')
            },
            {
                path: 'course-manage/:id',
                name: 'course-manage',
                component: () => import('@/views/course/CourseManageView')
            },
            {
                path: 'course-info-edit/:id',
                name: 'course-info-edit',
                component: () => import('@/views/course/CourseInfoEditView')
            },
            {
                path: 'course-structure-edit/:id',
                name: 'course-structure-edit',
                component: () => import('@/views/course/CourseStructureEditView')
            },
            {
                path: 'course-user-page/:id',
                name: 'course-user-page',
                component: () => import('@/views/course/bind/CourseUserPage')
            },
            {
                path: 'course-comment-page-audit/:courseId/:linkId/:auditId',
                name: 'course-comment-page-audit',
                component: () => import('@/views/course/bind/CourseCommentPage')
            },
            {
                path: 'course-comment-page/:id',
                name: 'course-comment-page',
                component: () => import('@/views/course/bind/CourseCommentPage')
            },
            {
                path: 'course-report-page/:id',
                name: 'course-report-page',
                component: () => import('@/views/course/bind/CourseReportPage')
            },
            {
                path: 'course-talk-page-audit/:courseId/:linkId/:auditId',
                name: 'course-talk-page-audit',
                component: () => import('@/views/course/bind/CourseTalkPage')
            },
            {
                path: 'course-talk-page/:id',
                name: 'course-talk-page',
                component: () => import('@/views/course/bind/CourseTalkPage')
            },
            {
                path: 'island-create',
                name: 'island-create',
                component: () => import('@/views/island/IslandCreateView')
            },
            {
                path: 'island-manage/:id',
                name: 'island-manage',
                component: () => import('@/views/island/IslandManageView')
            },
            {
                path: 'island-info-edit/:id',
                name: 'island-info-edit',
                component: () => import('@/views/island/IslandInfoEditView')
            },
            {
                path: 'island-post-page/:id',
                name: 'island-post-page',
                component: () => import('@/views/island/post/IslandPostPage')
            },
            {
                path: 'island-post-page-audit/:islandId/:linkId/:auditId',
                name: 'island-post-page-audit',
                component: () => import('@/views/island/post/IslandPostPage')
            },
            // {
            //     path: 'island-message-page/:id',
            //     name: 'island-message-page',
            //     component: () => import('@/views/create/island/bind/IslandMessagePage')
            // },
            {
                path: 'island-comment-page/:id',
                name: 'island-comment-page',
                component: () => import('@/views/island/bind/IslandCommentPage')
            },
            {
                path: 'island-comment-page-audit/:islandId/:linkId/:auditId',
                name: 'island-comment-page-audit',
                component: () => import('@/views/island/bind/IslandCommentPage')
            },
            {
                path: 'island-report-page/:id',
                name: 'island-report-page',
                component: () => import('@/views/island/bind/IslandReportPage')
            },
            {
                path: 'island-user-page/:id',
                name: 'island-user-page',
                component: () => import('@/views/island/bind/IslandUserPage')
            },

            {
                path: 'question-manage/:id',
                name: 'question-manage',
                component: () => import('@/views/question/QuestionManageView')
            },
            {
                path: 'question-info-edit/:id',
                name: 'question-info-edit',
                component: () => import('@/views/question/QuestionInfoEditView')
            },
            {
                path: 'question-point-page/:id',
                name: 'question-point-page',
                component: () => import('@/views/question/point/QuestionPointPage')
            },
            {
                path: 'question-point-page-audit/:questionId/:linkId/:auditId',
                name: 'question-point-page-audit',
                component: () => import('@/views/question/point/QuestionPointPage')
            },
            {
                path: 'question-answer-page/:id',
                name: 'question-answer-page',
                component: () => import('@/views/question/answer/QuestionAnswerPage')
            },
            {
                path: 'question-answer-page-audit/:questionId/:linkId/:auditId',
                name: 'question-answer-page-audit',
                component: () => import('@/views/question/answer/QuestionAnswerPage')
            },
            {
                path: 'question-comment-page/:id',
                name: 'question-comment-page',
                component: () => import('@/views/question/bind/QuestionCommentPage')
            },
            {
                path: 'question-comment-page-audit/:questionId/:linkId/:auditId',
                name: 'question-comment-page-audit',
                component: () => import('@/views/question/bind/QuestionCommentPage')
            },
            {
                path: 'question-report-page/:id',
                name: 'question-report-page',
                component: () => import('@/views/question/bind/QuestionReportPage')
            },

            {
                path: 'question-check-page/:id',
                name: 'question-check-page',
                component: () => import('@/views/question/bind/QuestionCheckPage')
            },

            {
                path: 'course-problem-page',
                name: 'course-problem-page',
                component: () => import('@/views/manage/course/problem/ProblemPageView')
            },
            {
                path: 'course-exam-page',
                name: 'course-exam-page',
                component: () => import('@/views/manage/course/exam/ExamPageView')
            },
            {
                path: 'course-exam-edit/:id',
                name: 'course-exam-edit',
                component: () => import('@/views/manage/course/exam/ExamEditView')
            },
        ]
    },

    ...userRoutes
]

const router = new VueRouter({
    mode: 'history',
    routes
})

export default router
